'use strict';
const requireEx=require('yi-require');
const $ = requireEx('yi-schema');
  module.exports = {
    query: $.object({
      page: $.object({
        size: $.number().integer().positive().default(10),
        index: $.number().integer().positive().default(1)
      }),
      filter: $.object({
        _id:[$.object({"$in":$.array().items($.mongoid())}).description("_id"),$.mongoid()],
        headPicPath:$.string().description("头像图片路径"),
        backgroundPicPath:$.string().description("背景图片路径"),
        nickname:$.object({"$regex":$.string().min(1).max(16)}).description("昵称"),
        sex:$.string().valid('男','女','未知').description("性别"),
        birthday:$.date().description("出生日期"),
        city:$.string().description("城市"),
        tel:$.mobile().description("绑定手机"),
        context:$.string().min(1).max(50).description("签名"),
        careID:$.object({"$in":$.array().items($.mongoid())}).description("关注者ID"),
        fansID:$.object({"$in":$.array().items($.mongoid())}).description("粉丝ID"),
        createTime:$.date().description("创建时间")
      }),
      project: $.object({
        _id:$.number().valid(0,1),
        headPicPath:$.number().valid(0, 1),
        backgroundPicPath: $.number().valid(0, 1),
        nickname: $.number().valid(0, 1),
        sex: $.number().valid(0, 1),
        birthday: $.number().valid(0, 1),
        city: $.number().valid(0, 1),
        tel: $.number().valid(0, 1),
        context: $.number().valid(0, 1),
        careID: $.number().valid(0, 1),
        fansID: $.number().valid(0, 1),
        commentState: $.number().valid(0, 1)
      }),
      sort: $.object({
        //_id:$.number().valid(-1,1),
        // name:$.number().valid(-1, 1),
        createTime: $.number().valid(-1, 1)
      })
    })
  };
